<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>合同列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/font.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/layui/layui.js"
            charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/xadmin.js"></script>
    <script charset="utf-8" language="javascript" type="text/javascript" src="JS/CommonFields/common.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">合同</a>
        <a>
          <cite>详细信息列表</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <table id="data" lay-filter="contract"></table>


</div>
<script>
    var table;
    layui.use(['table'], function () {
        table = layui.table;
        // 获取员工的详细信息
        var id = "${id}";
        console.log(id + "--------------------")
        table.render({
            elem: '#data'
            , cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            , height: 'full-200'
            , url: "${pageContext.request.contextPath}/contract/queryDetail?id="+id //数据接口
            , method: "post"
            , dataType: "json"
            , page: true //开启分页
            , cols: [[ //表头
                {type: 'checkbox', fixed: 'left'}
                , {field: 'contractId', title: 'ID', sort: true}
                , {field: 'contractName', title: '合同名称',}
                , {
                    field: 'contractType', title: '合同类型', templet: function (d) {
                        switch (d.contractType) {
                            case 0:
                                return '销售合同';
                                break;
                            case 1:
                                return '技术合同';
                                break;
                            case 2:
                                return '运输合同';
                                break;
                            case 3:
                                return '委托合同';
                                break;
                        }
                    }
                }
                , {field: 'contractAmount', title: '合同金额'}
                , {
                    field: 'contractStatus', title: '状态', templet: function (d) {
                        switch (d.contractStatus) {
                            case 0:
                                return '已订立';
                                break;
                            case 1:
                                return '已提交';
                                break;
                            case 2:
                                return '待审核';
                                break;
                            case 3:
                                return '已审核';
                                break;
                            case 4:
                                return '履行中';
                                break;
                            case 5:
                                return '已履行';
                                break;
                            case 6:
                                return '已变更';
                                break;
                            case 7:
                                return '已解除';
                                break;
                            case 8:
                                return '已转让';
                                break;
                            case 9:
                                return '已终止';
                                break;
                            case 10:
                                return '已归档';
                                break;
                        }
                    }
                }
                , {field: 'partyA', title: '合同甲方'}
                , {field: 'partyB', title: '合同乙方'}
                , {field: 'businessLicenseNoA', title: '甲方企业经营许可证号'}
                , {field: 'businessLicenseNoB', title: '乙方企业经营许可证号'}
                , {field: 'contractContents', title: '合同内容'}
                , {field: 'contractRemarks', title: '合同备注'}
                , {field: 'createTime', title: '创建时间', sort: true}
                , {
                    field: 'lastOperationTime', title: '最后操作时间', sort: true, templet: function (d) {
                        return d.lastOperationTime == null ? '未操作' : d.lastOperationTime;
                    }
                }
                , {field: 'updateTime', title: '更新时间'}
                , {field: 'createName', title: '创建人'}
                , {
                    field: 'operatorEmplId', title: '待处理人', templet: function (d) {
                        return d.empl.emplName;
                    }
                }
            ]]
        });
    });


</script>

</body>

</html>